import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node


def generate_launch_description():
    bringup_dir = get_package_share_directory('turn_on_bichon')
    launch_dir = os.path.join(bringup_dir, 'launch')

    bichon_camera = IncludeLaunchDescription(
        PythonLaunchDescriptionSource(os.path.join(
            bringup_dir, 'launch', 'bichon_camera.launch.py')),
    )
    bichon_robot = IncludeLaunchDescription(
        PythonLaunchDescriptionSource(os.path.join(
            launch_dir, 'turn_on_bichon.launch.py')),
    )
    return LaunchDescription([
        bichon_camera, bichon_robot,
        Node(
            package='bichon_kcf',
            executable='run_tracker_node',
            parameters=[{'targetDist_': 0.8}],
            output='screen',
        )
    ])
